//
//  CDManager.h
//  CoreDataDemo
//
//  Created by chenguibang on 16/2/26.
//  Copyright © 2016年 chenguibang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@interface CDManager : NSObject

@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

+(CDManager*)shareManager;
-(NSManagedObject*)entityWithNamed:(NSString*)entityName;

-(NSArray *)queryWithEntity:(NSString*)entityName key:(NSString *)key  value:(NSString*)value;

-(BOOL)saveContext;
@end
